package com.huawei.appgallery.foundation.ui.css.adapter;

import android.view.View;
import android.widget.TextView;
import com.huawei.appgallery.foundation.ui.css.adapter.param.MethodSignature;
import com.huawei.appgallery.foundation.ui.css.adapter.param.Parameter.Generator;
import com.huawei.appgallery.foundation.ui.css.adapter.type.CSSMonoColor;
import com.huawei.appgallery.foundation.ui.css.adapter.type.CSSPrimitive;
import o.dob;

public class TextViewAdapter extends RenderAdapter {
    protected static final CSSPropertyMethod CSS_PROPERTY_METHOD = new CSSPropertyMethod();
    public static final RenderAdapterFactory FACTORY = new RenderAdapterFactory() {
        public RenderAdapter create(View view) {
            return new TextViewAdapter();
        }
    };

    static {
        CSS_PROPERTY_METHOD.inherit(ViewAdapter.CSS_PROPERTY_METHOD);
        CSS_PROPERTY_METHOD.add(CSSPropertyName.FONT_COLOR, new MethodSignature(dob.ˏ(TextView.class, "setTextColor", Integer.TYPE), new Generator<CSSMonoColor>() {
            public Object get(Object obj, CSSMonoColor cSSMonoColor) {
                return Integer.valueOf(cSSMonoColor.getColor());
            }
        }));
        CSS_PROPERTY_METHOD.add(CSSPropertyName.FONT_SIZE, new MethodSignature(dob.ˏ(TextView.class, "setTextSize", Float.TYPE), new Generator<CSSPrimitive>() {
            public Object get(Object obj, CSSPrimitive cSSPrimitive) {
                return cSSPrimitive.asFloat();
            }
        }));
    }

    public MethodSignature getMethod(String str) {
        return CSS_PROPERTY_METHOD.getSignature(str);
    }
}
